﻿using MediatR;
using T_settlement.Domain;
using T_settlement.Infrastructure.Interfacec;
using T_settlement.Read.API.Application.Command.OutputCommand;

namespace T_settlement.Read.API.Application.CommandHandlers.OutputCommandHandlers
{
    public class FanOutputCommandHandlers:IRequestHandler<FanOutputCommand,Output>
    {
        private readonly IOutputRepository outputRepository;

        public FanOutputCommandHandlers(IOutputRepository outputRepository)
        {
            this.outputRepository = outputRepository;
        }

        public async Task<Output> Handle(FanOutputCommand request, CancellationToken cancellationToken)
        {
            var list = outputRepository.GetModelAsync(request.OutputId);
            return await list;
        }
    }
}
